package com.xbongbong.paas.pojo.dto;

import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.Valid;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;

/**
 * @author: wufeng
 * @date: 2018/8/10 15:13
 * @desrcption: 表单设计对象
 */
@Getter
@Setter
@ToString
public class FormUpdateDTO extends BaseDTO {

    private static final long serialVersionUID = 6845449318811350095L;

    /**
     * 应用id
     */
    @NotNull(message = "{dto.msg.formUpdate.appId.NotNull}")
    private Long appId;
    /**
     * 表单id
     */
    @NotNull(message = "{dto.msg.formUpdate.formId.NotNull}")
    private Long formId;

    /**
     * 表单id
     */
    @NotNull(message = "{dto.msg.formUpdate.formExplainId.NotNull}")
    private Long formExplainId;

    @Valid
    @NotNull(message = "{dto.msg.formUpdate.formAttr.NotNull}")
    private FormEntityUpdateDTO formAttr;

    /**
     * 表单字段描述信息
     */
    @Valid
    @Size(max = 170, message = "{dto.msg.formUpdate.explainList.Size}")
    private List<FieldAttrEntity> explainList;

    /**
     * 业务类型
     */
    private Integer businessType;

    private List<String> delFieldList;

    /**
     * 字段回收站attr
     */
    private Set<String> trashList;

    public FormUpdateDTO(){
        delFieldList = new ArrayList<>();
    }

    /**
     * 菜单id
     */
    private Long menuId;

    /**
     * 是否是saas 1：saas  2：paas
     */
    @DecimalMin(value = "1", message = "{dto.msg.formUpdate.saasMark.DecimalMin}")
    @DecimalMax(value = "2", message = "{dto.msg.formUpdate.saasMark.DecimalMax}")
    @NotNull(message = "{dto.msg.formUpdate.saasMark.NotNull}")
    private Integer saasMark;


}
